<?php namespace Summer\Hjd\Updates;

use Schema;
use Winter\Storm\Database\Updates\Migration;

class BuilderTableCreateSummerHjdBonusRule extends Migration
{
    public function up()
    {
        Schema::create('summer_hjd_bonus_rule', function($table)
        {
            $table->engine = 'InnoDB';
            $table->increments('id')->unsigned();
            $table->timestamp('created_at')->nullable();
            $table->timestamp('updated_at')->nullable();
            $table->string('slug');
            $table->string('title');
            $table->string('group');
            $table->integer('status')->nullable()->default(1);
            $table->integer('has_status')->nullable()->default(0);//zp完善，是否显示开关
            $table->string('rule_value')->nullable();
            $table->string('rule_level')->nullable();
            $table->decimal('rule_min', 14, 2)->nullable()->default(0.00);
            $table->decimal('rule_max', 14, 2)->nullable()->default(0.00);
            $table->decimal('rule_cap', 14, 2)->nullable()->default(0.00);
            $table->text('rule_text')->nullable();
            $table->string('rule_a')->nullable();
            $table->string('rule_b')->nullable();
            $table->string('rule_c')->nullable();
            $table->string('rule_d')->nullable();
            $table->string('rule_e')->nullable();
            $table->string('rule_f')->nullable();
            $table->string('rule_g')->nullable();
        });
    }
    
    public function down()
    {
        Schema::dropIfExists('summer_hjd_bonus_rule');
    }
}
